import { AttackType, HurtType } from "js/typeDefine/typeDefine"
import { FighterModel, SkillModel } from "./fighterModel"

export class CalcDamageDataModel {
    attacker: FighterModel
    attackType?: AttackType 
    attackHurtCoe: number
    hurtPer: number //伤害提升
    hurtDec: number //伤害递减
    hurtInc: number //伤害递增
    skillID?: number
    skillLvl?: number
    hurtType: HurtType
    isDodge: boolean
    isCrit: boolean
    decHpName: string
    addHpName: string
    skill: SkillModel
    decHpAnimationDelay: number
    angerHurtPer: number
    constructor(opts: any = {}) {
        this.attacker = opts.attacker || null
        this.attackType = opts.attackType || AttackType.Normal
        this.attackHurtCoe = opts.attackHurtCoe || 100
        this.hurtPer = opts.hurtPer || 0
        this.hurtDec = opts.hurtDec || 0
        this.hurtInc = opts.hurtInc || 0
        this.skillID = opts.skillID || 0
        this.skillLvl = opts.skillLvl || 0
        this.hurtType = opts.hurtType || HurtType.Normal
        this.isDodge = opts.isDodge || false
        this.isCrit = opts.isCrit || false
        this.decHpName = opts.decHpName || ''
        this.addHpName =  opts.addHpName || ''
        this.skill = opts.skill || null
        this.decHpAnimationDelay = opts.decHpAnimationDelay || 0
        this.angerHurtPer = opts.angerHurtPer || 0
    }
}